﻿package mortal.game.net.command.autoArena
{
    import Framework.MQ.*;
    import Message.Command.*;
    import Message.Public.*;
    import com.gengine.debug.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.mvc.core.*;

    public class AutoArenaCommand extends BroadCastCall
    {

        public function AutoArenaCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_2:SAutoArenaMinPlayers = null;
            var _loc_3:SAutoArenaRankUpdate = null;
            var _loc_4:SAutoArenaEnemys = null;
            var _loc_5:SAutoArenaMyInfo = null;
            var _loc_6:SAutoArenaFightReport = null;
            var _loc_7:SAutoArenaResult = null;
            var _loc_8:SAutoArenaRewardMsg = null;
            var _loc_9:SAutoArenaRecordsMsg = null;
            var _loc_10:SSeqArenaBasePlayerMsg = null;
            Log.debug("I have receive AutoArenaCommand");
            super.call(param1);
            switch(param1.messageHead.command)
            {
                case EPublicCommand._ECmdPublicAutoArenaRankInfo:
                {
                    _loc_2 = param1.messageBase as SAutoArenaMinPlayers;
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaRankUpdate:
                {
                    _loc_3 = param1.messageBase as SAutoArenaRankUpdate;
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaEnemy:
                {
                    _loc_4 = param1.messageBase as SAutoArenaEnemys;
                    Cache.instance.autoArena.enemys = _loc_4;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaGetChallengerInfo, null);
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaMyInfo:
                {
                    _loc_5 = param1.messageBase as SAutoArenaMyInfo;
                    Cache.instance.autoArena.sAutoArenaMyInfo = _loc_5;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaGetMyInfo, _loc_5);
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaFightReport:
                {
                    _loc_6 = param1.messageBase as SAutoArenaFightReport;
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaResult:
                {
                    _loc_7 = param1.messageBase as SAutoArenaResult;
                    Cache.instance.autoArena.sAutoArenaResult = _loc_7;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaShowResult, null);
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaDayReward:
                {
                    _loc_8 = param1.messageBase as SAutoArenaRewardMsg;
                    Cache.instance.autoArena.sAutoArenaDayReward = _loc_8;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaUpdateDayReward, null);
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaGetToplist:
                {
                    _loc_10 = param1.messageBase as SSeqArenaBasePlayerMsg;
                    Cache.instance.autoArena.autoArenaRankArr = _loc_10.basePlayers;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaGetRankInfo, null);
                    break;
                }
                case EPublicCommand._ECmdPublicAutoArenaMyRecord:
                {
                    _loc_9 = param1.messageBase as SAutoArenaRecordsMsg;
                    Cache.instance.autoArena.autoArenaRecordArr = _loc_9.records;
                    NetDispatcher.dispatchCmd(ServerCommand.AutoArenaGetMyRecord, null);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
